<template>
  <div class="w-index-hot">
    <div class="w-index-hot-title">
      热门楼盘
      <span class="more" @click="goFloorPage">查看更多></span>
    </div>
    <swiper :options="swiperOption">
      <swiperSlide v-for="(item,i) in hotList" :key="i">
        <div class="w-slide-item" @click="goFloorDetail(item.id)">
          <img :src="item.logo">
          <div class="w-slide-item-title">{{item.name}}</div>
        </div>
      </swiperSlide>
    </swiper>
  </div>
</template>

<script>
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
  props: ["hotList"],
  components: {
    swiper,
    swiperSlide
  },

  data() {
    return {
      swiperOption: {
        slidesPerView: "auto",
        loopedSlides: 8
      }
    };
  },
  methods: {
    goFloorDetail(id) {
      console.log(111);
      this.$router.push({
        path: "/floordetail",
        query: {
          id: id
        }
      });
    },
    goFloorPage() {
      this.$router.push({
        path: "/floor",
        query: {
          id: 1
        }
      });
    }
  },
  created() {
    // console.log(this.hotList);
  }
};
</script>

<style lang="scss">
.w-index-hot {
  padding-top: 60px;
  padding-left: 48px;
  background: #fff;
  .w-index-hot-title {
    font-size: 36px;
    color: #333333;
    font-weight: 500;
    padding-right: 24px;
    line-height: 36px;
    margin-bottom: 30px;
    .more {
      float: right;
      font-size: 28px;
      color: #7f7f7f;
    }
  }
  .swiper-slide {
    width: 396px;
    margin-right: 30px;
  }
  .w-slide-item {
    img {
      width: 396px;
      height: 248px;
    }
    .w-slide-item-title {
      text-align: center;
      font-size: 30px;
      line-height: 98px;
    }
  }
}
</style>